package com.tianji.learning.controller;


import com.tianji.common.utils.BeanUtils;
import com.tianji.common.utils.CollUtils;
import com.tianji.learning.domain.po.PointsBoardSeason;
import com.tianji.learning.domain.vo.PointsBoardSeasonVO;
import com.tianji.learning.service.IPointsBoardSeasonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liuchun
 * @since 2024-09-07
 */
@RestController
@RequestMapping("/boards/seasons")
public class PointsBoardSeasonController {

    @Autowired
    private IPointsBoardSeasonService pointsBoardSeasonService;

    @GetMapping("/list")
    public List<PointsBoardSeasonVO> listSeason(){
        List<PointsBoardSeason> list = pointsBoardSeasonService.list();
        if (CollUtils.isEmpty(list)){
            return CollUtils.emptyList();
        }
        List<PointsBoardSeasonVO> vos = BeanUtils.copyList(list, PointsBoardSeasonVO.class);
        return vos;
    }
}
